(function() {
    function j(a) {
        return document.getElementById(a)
    }

    function E(a) {
        if (document.querySelectorAll) return document.querySelectorAll("." + a);
        for (var c = [], a = RegExp("(//s|^)" + a + "($|//s)"), b = document.getElementsByTagName("*"), i = 0; i < b.length; i++) a.test(b[i].className) && c.push(b[i]);
        return c
    }

    function l(a, c, b) {
        a.addEventListener ? a.addEventListener(c, b, false) : a.attachEvent ? a.attachEvent("on" + c, b) : a["on" + c] = b
    }

    function K() {
        var a = window.innerHeight;
        typeof a != "number" && (a = document.compatMode == "CSS1Compat" ? document.documentElement.clientHeight : document.body.clientHeight);
        return a
    }

    function L() {
        var a = window.innerWidth;
        typeof a != "number" && (a = document.compatMode == "CSS1Compat" ? document.documentElement.clientWidth : document.body.clientWidth);
        return a
    }
    var x = /msie 6/i.test(navigator.userAgent);
    Array.prototype.map || (Array.prototype.map = function(a, c) {
        var b, i, h;
        if (this == null) return false;
        var g = Object(this),
            m = g.length >>> 0;
        if ({}.toString.call(a) != "[object Function]") return false;
        for (c && (b = c), i = Array(m), h = 0; h < m;) {
            var d, f;
            h in g && (d = g[h], f = a.call(b, d, h, g), i[h] = f);
            h++
        }
        return i
    });
    window.jQueryproduct = function(a) {
        l(window, "load", a)
    };
    window.jsproduct = {
        addFavorite: function(a) {
            var c = a.url ? "http://" + a.url : location.href,
                b = a.title;
            (a = j(a.id)) && l(a, "click", function() {
                try {
                    window.external.addFavorite(c, b)
                } catch (a) {
                    try {
                        window.sidebar.addPanel(b, c, "")
                    } catch (h) {}
                }
                return false
            })
        },
        setHomePage: function(a) {
            var c = a.url ? "http://" + a.url : location.href;
            (a = j(a.id)) && l(a, "click", function() {
                if (document.all) document.body.style.behavior = "url(#default#homepage)", document.body.setHomePage(c);
                return false
            })
        },
        fixPng: function(a) {
            x && E(a.cls).map(function(a) {
                var b = a.src.toUpperCase();
                if (b.substring(b.length - 3, b.length) == "PNG") {
                    var b = a.id ? "id='" + a.id + "'" : "",
                        i = a.className ? "class='" + a.className + "' " : "",
                        h = a.title ? "title='" + a.title + "' " : "title='" + a.alt + "' ",
                        g = "display:inline-block;" + a.style.cssText;
                    a.parentElement.href && (g = "cursor:hand;" + g);
                    a.outerHTML = "<span " + b + i + h + ' style="width:' + a.width + "px; height:" + a.height + "px;" + g + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + a.src + "', sizingMethod='scale');\"></span>"
                }
            })
        },
        floatDiv: function(a) {
            function c(a) {
                clearInterval(f);
                f = setInterval(function() {
                    var c = (b.offsetLeft - a) / 5,
                        c = c > 0 ? Math.ceil(c) : Math.floor(c);
                    b.offsetLeft == a ? clearInterval(f) : b.style.left = b.offsetLeft - c + "px"
                }, 30)
            }
            var b = j(a.id),
                i = parseInt(a.top, 10),
                h = L(),
                g = 0,
                m = 0,
                d = 0,
                f = null,
                k = document.body.offsetHeight >= K() ? 15 : 0;
            b.style.position = x ? "absolute" : "fixed";
            b.style.top = i + "px";
            a.left ? (d = parseInt(a.left, 10), b.style.left = d + "px", g = 0, m = d) : (d = parseInt(a.right, 10), b.style.right = d + "px", g = h - b.offsetWidth - k, m = h + d);
            d < 0 && (l(b, "mouseover", function() {
                c(g)
            }), l(b, "mouseout", function() {
                c(m)
            }));
            x && l(window, "scroll", function() {
                clearTimeout(a);
                var a = setTimeout(function() {
                    b.style.top = (document.documentElement.scrollTop || document.body.scrollTop) + i + "px"
                }, 1)
            })
        },
        linkage: function(a) {
            for (var c = a.data, b = j(a.id1), i = j(a.id2), h, g, m, d, f = 0; f < c[0].length; f++) h = new Option(c[0][f], c[0][f]), i.add(h, void 0);
            l(b, "change", function() {
                g = b.options[b.selectedIndex].index;
                m = c[g];
                d = i.options.length;
                for (f = 0; f < c[g].length; f++) h = new Option(m[f], m[f]), i.add(h, void 0);
                for (f = 0; f < d; f++) i.remove(0)
            })
        },
        tab: function(a) {
            var c = a.btns,
                b = a.tabs,
                i = null,
                h = a.activeClassName,
                g = a.eventType || 1,
                m = null,
                d = a.delay || 150;
            switch (g) {
                case 1:
                    g = "mouseover";
                    break;
                case 2:
                    g = "click"
            }
            for (a = 0; a < c.length; a++) j(b[a]).style.display = "none", l(j(c[a]), g, function(a) {
                return function() {
                    clearTimeout(i);
                    i = setTimeout(function() {
                        for (var d = 0; d < c.length; d++) a == d ? (j(c[d]).className += " " + h, j(b[d]).style.display = "block") : (m = eval("/(^" + h + ")|((\\s)" + h + ")/g"), j(c[d]).className = j(c[d]).className.replace(m, ""), j(b[d]).style.display = "none");
                        return false
                    }, d)
                }
            }(a));
            j(b[0]).style.display = "block"
        },
        downMenu: function(a) {
            for (var c = j(a.id), b = (a.pElement || "LI").toUpperCase(), i = (a.cElement || "UL").toUpperCase(), h = a.cls, g = c.getElementsByTagName(b), c = 0; c < g.length; c++) l(g[c], "mouseover", function(c) {
                return function() {
                    if (g[c].parentNode.parentNode.id != a.id) g[c].parentNode.parentNode.className = h;
                    for (var b = g[c].childNodes, f = 0; f < b.length; f++)
                        if (b[f].tagName == i) b[f].style.display = "block"
                }
            }(c)), l(g[c], "mouseout", function(c) {
                return function() {
                    if (g[c].parentNode.parentNode.id != a.id) g[c].parentNode.parentNode.className = "";
                    for (var b = g[c].childNodes, f = 0; f < b.length; f++)
                        if (b[f].tagName == i) b[f].style.display = "none"
                }
            }(c))
        },
        scroll: function(a) {
            function c() {
                r === "top" || r === "left" ? i() : (r === "bottom" || r === "right") && b()
            }

            function b() {
                d.insertBefore(k[k.length - 1], d.firstChild);
                d.style[u] = -s + "px";
                h(0)
            }

            function i() {
                h(-s, function() {
                    d.appendChild(k[0]);
                    d.style[u] = "0px"
                })
            }

            function h(a, c) {
                clearInterval(y);
                y = setInterval(function() {
                    var b = (a - d[t] + f) / 5,
                        b = b > 0 ? Math.ceil(b) : Math.floor(b);
                    a + f == d[t] ? (clearInterval(y), c && c.apply(g)) : d.style[u] = b + d[t] - f + "px"
                }, 30)
            }
            if (!a.box || !a.list) return false;
            var g = this,
                m = j(a.box),
                d = j(a.list),
                f = 0,
                k = d.children,
                y = null,
                o = null,
                s = 0,
                r = a.direction || "top",
                u = "top",
                t = "offsetTop",
                A = j(a.advanceArrow),
                v = j(a.retreatArrow),
                p = a.spacing || 4E3;
            m.style.position = "relative";
            d.style.position = "relative";
            if (r === "top" || r === "bottom") s = k[1].offsetTop - k[0].offsetTop, u = "top", f = d.offsetTop, t = "offsetTop";
            else if (r === "left" || r === "right") s = k[1].offsetLeft - k[0].offsetLeft, u = "left", f = d.offsetLeft, t = "offsetLeft";
            A && l(A, "click", function() {
                clearInterval(o);
                b();
                o = setInterval(function() {
                    c()
                }, p)
            });
            v && l(v, "click", function() {
                clearInterval(o);
                i();
                o = setInterval(function() {
                    c()
                }, p)
            });
            o = setInterval(function() {
                c()
            }, p);
            l(d, "mouseover", function() {
                clearInterval(o)
            });
            l(d, "mouseout", function() {
                o = setInterval(function() {
                    c()
                }, p)
            })
        },
        slider: function(a) {
            function c() {
                var a = document.createElement("div");
                a.style.overflow = "hidden";
                a.id = w;
                a.innerHTML = o[0].title;
                f.appendChild(a)
            }

            function b(a) {
                clearInterval(F);
                clearInterval(G);
                var b = j(w);
                if (!b) return false;
                F = setInterval(function() {
                    var c = Math.ceil(b.offsetHeight / 5);
                    b.style.height = b.offsetHeight - c + "px";
                    if (b.offsetHeight == 0) clearInterval(F), b.innerHTML = o[a].title, G = setInterval(function() {
                        var a = Math.ceil((H - b.offsetHeight) / 5);
                        b.style.height = b.offsetHeight + a + "px";
                        b.offsetHeight >= H && clearInterval(G)
                    }, 20)
                }, 30)
            }

            function i(a) {
                for (var b = 0; b < B.length; b++) B[b].className = a === b ? I : ""
            }

            function h(a, b) {
                switch (a) {
                    case 1:
                        g(b);
                        break;
                    case 2:
                        m(b);
                        break;
                    default:
                        m(b)
                }
            }

            function g(a, b) {
                var c = -t * a;
                clearInterval(x);
                x = setInterval(function() {
                    var a = (c - k[v] + C) / 5,
                        a = a > 0 ? Math.ceil(a) : Math.floor(a);
                    c + C == k[v] ? (clearInterval(x), b && b.apply(d)) : k.style[A] = a + k[v] - C + "px"
                }, 30)
            }

            function m(a) {
                var b = o[0],
                    c;
                b.style.opacity = 0;
                b.style.filter = "alpha(opacity=0);";
                b.src = r[a];
                if (s.length > 0) s[0].href = u[a];
                var d = setInterval(function() {
                    c = parseInt((b.style.opacity || 0) * 100);
                    speed = Math.ceil((100 - c) / 10);
                    b.style.filter = "alpha(opacity=" + (c + speed) + ");";
                    b.style.opacity = (c + speed) / 100;
                    c >= 100 && clearInterval(d)
                }, 100)
            }
            var d = this,
                f = j(a.box),
                k = j(a.list),
                y = a.type || 1,
                o = k.getElementsByTagName("img"),
                s = k.getElementsByTagName("a"),
                r = [],
                u = [],
                t = 0,
                A = "top",
                v = "offsetTop",
                p = k.children,
                z = null,
                B = null,
                x = null,
                D = null,
                F = null,
                G = null,
                H = 0,
                n = 0,
                C = 0,
                J = a.spacing || 4E3,
                E = a.btnListClass,
                I = a.btnClass,
                w = a.showText;
            f.style.position = "relative";
            k.style.position = "relative";
            for (var q = 0; q < o.length; q++) r.push(o[q].src);
            if (s.length > 0)
                for (q = 0; q < s.length; q++) u.push(s[q].href);
            a.direction === "top" ? (t = p[1].offsetTop - p[0].offsetTop, A = "top", C = k.offsetTop, v = "offsetTop") : (t = p[1].offsetLeft - p[0].offsetLeft, A = "left", C = k.offsetLeft, v = "offsetLeft");
            w && c();
            (function() {
                var a = "";
                z = document.createElement("ul");
                z.className = E;
                for (var b = 0; b < p.length; b++) a += "<li>" + (b + 1) + "</li>";
                z.innerHTML = a;
                z.children[0].className = I;
                f.appendChild(z)
            })();
            if (j(w)) H = j(w).offsetHeight;
            B = z.getElementsByTagName("li");
            for (q = 0; q < B.length; q++) l(B[q], "click", function(a) {
                return function() {
                    clearInterval(D);
                    i(a);
                    h(y, a);
                    n = a;
                    w && b(n)
                }
            }(q));
            D = setInterval(function() {
                n = n >= p.length - 1 ? 0 : ++n;
                i(n);
                h(y, n);
                w && b(n)
            }, J);
            l(f, "mouseover", function() {
                clearInterval(D)
            });
            l(f, "mouseout", function() {
                D = setInterval(function() {
                    n = n >= p.length - 1 ? 0 : ++n;
                    i(n);
                    h(y, n);
                    w && b(n)
                }, J)
            })
        },
        foldMenu: function(a) {
            var c = j(a.id),
                b = a.foldElement && a.foldElement.toLowerCase() || "UL",
                i = a.foldChildElement || "LI",
                h = a.afterClassName,
                g = null;
            l(c, "click", function(a) {
                e = window.event || a;
                for (a = e.srcElement || e.target; a.tagName != i && a != c && a.tagName != "BODY";) a = a.parentNode;
                if (a.getElementsByTagName(b).length > 0 && (a.getElementsByTagName(b)[0].style.display = a.getElementsByTagName(b)[0].style.display === "block" ? "none" : "block", h)) g = eval("/(^" + h + ")|((\\s)" + h + ")/g"), a.getElementsByTagName(b)[0].style.display === "block" ? a.className += " " + h : a.className = a.className.replace(g, "")
            })
        }
    }
})();
